#include <iostream>
using namespace std;
int main()
{
long long n;
int sum=0,a;
cin>>n;
do
{
a=n%2;
sum+=a;
cout <<a;
n/=2;	
}while(n!=0);
cout <<endl;
cout <<sum<<endl;
return 0;	
}
//输入17 输出10001 2
